#!/usr/bin/env node

const Dog = require('./05-dog');

function barkHandler(name) {
  console.log(`${name} is barking! Energy: ${this.getEnergy()}`);
}

const dog1 = new Dog('Buddy', 5);
const dog2 = new Dog('Max', 3);
const dog3 = new Dog('Charlie', 7);

dog1.on('bark', barkHandler);
dog2.on('bark', barkHandler);
dog3.on('bark', barkHandler);